Positioning HTML Elements using Absolute Positioning

Using absolute positioning you can position elements at fixed locations in an HTML Web page. An HTML element positioned using absolute positioning appears at the same location in all the Web browsers.

Let’s do the following steps to position an HTML element using absolute positioning:


<!DOCTYPE html>
<html>
<head>
    <title>Positioning HTML Elements using absolute Positioning</title>
</head>
<body>
    <h2 style=”position: absolute; left: 50px; top: 100px” >
    This text is at an absolute position</h2>
</body>
</html>

Save the document with the name absolutePositiong.html and open with browser.